import { CustomI18NITF } from '@INTERFACES/Common'
import { TagITF } from '@INTERFACES/Tag'
import { PatientITF } from '@INTERFACES/Patient'
import { GoodSKUITF, ShipmentITF } from '@INTERFACES/Goods'
import { CHARGE_TYPE_ENUM, SHIPMENT_STATUS_ENUM } from '@CONSTANTS/order'
import { PAIN_MANAGEMENT_STATUS_ENUM, PLAN_ENTITY_TYPE_ENUM } from '@CONSTANTS/planManagement'
import { PAIN_MANAGEMENT_ACTION } from '@CONSTANTS/common'
import { DECISION_TYPE } from '@CONSTANTS/decision'

export interface DailyContentITF {
  EntityType: PLAN_ENTITY_TYPE_ENUM;
  EntityId: string;
  Title: CustomI18NITF;
  Description: string;
  DisplayTitle: CustomI18NITF;
  PictureFileName: string;
  Viewed?: boolean;
  ReminderHour: number;
  FinishedTime: number;
  Length: number;
  Disabled: boolean;
  ActionRequired: boolean;
  ResultEntityId: string;
  Important: boolean;
}

export interface DailyContentsITF {
  CurrentDay: number;
  Contents: DailyContentITF[];
  DailyTitle?: CustomI18NITF;
}

interface IntoArticleITF {
  FeedItemId: string;
  Title: string;
}

export interface PicTextConsultationITF {
  UnitCost: number;
  Quantity: number;
  ConsumedQuantity: number;
  Name: string;
}

export interface PlanManagementITF {
  _id: string;
  p8Id?: string;
  PainManagementId: string;
  CurrentDay: number;
  Type: string;
  Tags: TagITF[];
  Title: CustomI18NITF;
  Status: PAIN_MANAGEMENT_STATUS_ENUM;
  Duration: number;
  TemplateId?: string;
  Description: CustomI18NITF;
  DailyContents: DailyContentsITF[];
  ParticipantNumber: number;
  HasPainManagement: boolean;
  Action?: PAIN_MANAGEMENT_ACTION;
  CreatedDate?: number;
  ModifiedDate?: number;
  DoneForTodayFlag?: boolean;
  ScreenId: string;
  ScreenType: DECISION_TYPE;
  ScreenTitle: CustomI18NITF;
  UploadDate?: number;
  Price: number;
  OriginalPrice?: number;
  PromoNote: CustomI18NITF;
  IntoArticle?: IntoArticleITF;
  GoodsList?: GoodSKUITF[];
  ShipmentList: ShipmentITF[];
  ShipmentState: SHIPMENT_STATUS_ENUM;
  PicTextConsultation: PicTextConsultationITF;
  Participated: boolean;
  OrderId: string;
  ExpireDate?: number;
  SignedDate: number;
  ChargeType: CHARGE_TYPE_ENUM;
  ReportViewed?: boolean;
  PreviewPictureFileName?: string;
  HeadPictureFileName?: string;
}

export interface PainManagementRecordITF {
  StartDate: number;
  EndDate: number;
  Completion: number;
  Patient: PatientITF
}

export interface PlanSummaryITF {
  Duration: number;
  CurrentDay: number;
  TotalTask: number;
  FinishedTask: number;
  MeditationTotal: number;
  MeditationTotalFinished: number;
  TotalRemindTask: number;
  ViewedRemindTask: number;
  FinishedDayCount?: number;
  TotalImportantTask: number;
  ViewedImportantTask?: number;
}

export interface SurveySummaryITF {
  FrequencyArray: Array<number>;
  FrequencyTrend: number;
  TotalTimeArray: Array<number>;
  TotalTimeTrend: number;
  OverRatingHigh: Array<number>;
  OverRatingLow: Array<number>;
  OverallRatingTrend: number;
  LifeImpactArray: Array<number>;
  WeekArray: Array<string>;
  LifeImpactTrend: number;
}

export interface ReportResultITF {
  PainManagement: PlanManagementDataITF;
  Summary: PlanSummaryITF;
  SurveySummary: SurveySummaryITF
}

export interface PlanManagementDataITF {
  PainManagementId: string;
  CreatedDate: number;
  ExpireDate: number;
  Patient: PatientITF;
  Duration: number;
  Title: CustomI18NITF;
  TemplateId: string;
}

export interface TrendITF {
  FrequencyTrend: number,
  TotalTimeTrend: number,
  OverallRatingTrend: number,
  LifeImpactTrend: number
}
